package com.jxb.test20241216;

/**
 * 类注释
 *
 * @author jiaobo
 * @date Created in 2024/12/23 0:47
 **/
public class Sort2 {

    public static void main(String[] args) {

    }

    public int[] sort(int[] arr) {
        for (int i = 0;i<arr.length;i++) {
            int min = arr[i];
            int index = i;
            for (int j = i;j<arr.length;j++) {
                if (min > arr[j]) {
                    min = arr[j];
                    index = j;
                }
            }
            int temp = arr[i];
            arr[i] = min;
            arr[index] = temp;
        }
        return arr;
    }

}
